package cn.xiaobai;

import org.noear.solon.Solon;
import org.noear.solon.annotation.Controller;
import org.noear.solon.annotation.Get;
import org.noear.solon.annotation.Mapping;
import org.noear.solon.annotation.SolonMain;
import org.noear.solon.core.handle.ModelAndView;

import java.sql.SQLException;

/**
 * @Author yangdaji
 * @Date 2024/2/9
 * @PackageName cn.xiaobai
 * @ClassName SolonApplication
 */
@SolonMain
@Controller
public class SolonApplication {

    public static void main(String[] args) throws SQLException {
        Solon.start(SolonApplication.class, args);
    }

    @Get
    @Mapping("/test")
    public String test() {
        return "aaa";
    }

    @Mapping("/test2")
    public ModelAndView test2() {
        return new ModelAndView("test.html").put("test", "hello");
    }
}
